<template>
  <div class="equipmentManage flowCloumn h100">
    <div class="constentBttom flowWrap h100 tab-switch">
      <div class="constentTree h100 treeDiv">
        <customTree
          ref="equipTree"
          :draggable="false"
          :btnArr="btnArr"
          :nodeKey="nodeKey"
          :itemArrs="itemArrs"
          @handleClickTree="handleClickTree"
        ></customTree>
      </div>
       <div class="draggingBtn">
        <widthResize></widthResize>
      </div>
      <div class="constentmain h100 tableDiv">
        <basicInfo :currentNode="currentNode" @removePreviousNode="removePreviousNode" @updateTree="updateTree" menuType="edit"></basicInfo>
      </div>
    </div>
  </div>
</template>
<script>
import basicInfo from "./basicInfo";
import testEdit from "./testEdit";
// import customTree from "@/components/customTree/customTree";
import customTree from "../customTree";

import { getLeftUpperApi } from "@/api/equipmentLedger/equipmentManage";
export default {
  components: { customTree, basicInfo },
  data() {
    return {
      userInfo: this.$store.getters.userInfo,
      hideBtn: true,
      haveRemark: true,
      currentNode: {},
      itemArrs: [],
      btnArr: [],
      nodeKey: "id",
      updataType: ""
    };
  },
  computed: {
    systemOrg() {
      return localStorage.getItem("currOrg");
    }
  },
  created() {},
  mounted() {},
  methods: {
    updateTree(type) {
      //当提交和保存时，type有值，前端显示当前节点的数据；否则前端默认显示第一个节点的数据
      let node = null;
      if (type) {
        node = this.currentNode;
      }
      this.$refs.equipTree.updataData(node);
    },
    removePreviousNode(id) {
      this.$refs.equipTree.removeData(id)
    },
    //点击树
    handleClickTree(node) {
      this.currentNode = node;
    }
  }
};
</script>
<style lang="less" scoped>
.equipmentManage {
  .flowCloumn {
    background-color: #ffffff;
  }
}
</style>